package team.seekers.hula.common.entity.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum  MindTypeEnum implements IEnum<Integer> {

    ADD_QUESTION(1, "ADD_QUESTION", "提出一个问题"),
    ADD_POINT(2, "ADD_POINT", "提出一个观点"),
    ADD_ANSWER(3, "ADD_ANSWER", "回答一个问题"),
    ADD_NORMAL(4,"ADD_NORMAL","写一个新的普通mind"),

    ADD_QUESTION_PUSH(5,"ADD_RECOMMEND","新推荐一个提问（暗流专属）"),
    ADD_POINT_PUSH(6,"ADD_RECOMMEND","新推荐一个观点（暗流专属）"),
    ADD_ANSWER_PUSH(7,"ADD_RECOMMEND","新推荐一个回答（暗流专属）");

    private int type;

    private String name;

    private String cnName;

    MindTypeEnum(int type, String name, String cnName) {
        this.type = type;
        this.name = name;
        this.cnName = cnName;
    }

    @Override
    public Integer getValue() {
        return this.type;
    }

    public static MindTypeEnum getByType(int type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }

    public static MindTypeEnum getByName(String name) {
        return Arrays.stream(values()).filter(e -> e.getName().equals(name)).findFirst().orElse(null);
    }
}
